class PrettyPrint:
    """This class is used to print the output of the extraction process."""
    #___________________________________________________________________________

    def __init__(self, format=""):
        self.header = self.panlexWholeHeader
        self.record = self.panlexWholeOneToOne
        
    #___________________________________________________________________________


    def panlexWholeHeader(self, sourceLang="", targetLangList=[]):
        record = unicode("")
        targetLangs = len(targetLangList)
        if targetLangs > 1:
            record = "1\n%s\n\n" % sourceLang
        else:
            record = "2\n%s\n%s\n\n" % (sourceLang,targetLangList[0])
        return record
    
    #___________________________________________________________________________


    def panlexWholeOneToOne(self, sourceEX, targetEX, sourceMI="", sourceWC="", targetWC=""):
        record = unicode("")
        if sourceMI:
            record += "mi\n%s\n" % (sourceMI)
        record += "ex\n%s\n" % (sourceEX)
        if sourceWC:
            record += "wc\n%s\n" % (sourceWC)
        record += "ex\n%s\n" % (targetEX)
        if targetWC:
            record += "wc\n%s\n" % (targetWC)
        record += "\n"
        return record
    
    #___________________________________________________________________________



